home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_teo_gearlines.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  124 lines

  1. # Jones 3D Cog Script
  2. #
  3. # TEO_GearLines.cog
  4. # [SXC]
  5. #
  6. # (C) 1998 LucasArts Entertainment Co. All Rights Reserved
  7. # ========================================================================================
  8.  
  9. symbols
  10.  
  11.     message        activated
  12.     message        startup
  13.  
  14.     cog            gearSwitchCog
  15.     cog            spinSwitchCog
  16.  
  17.     sound        azerimline=to03j02.wav    local
  18.  
  19.     sound        indyline0=inxj090.wav    local
  20.     sound        indyline1=inxj050.wav    local
  21.     sound        indyline2=inxj058.wav    local
  22.     sound        indyline3=inxj032a.wav    local
  23.  
  24.     sound        indylineb0=inxj058.wav    local
  25.     sound        indylineb1=inxj059.wav    local
  26.     sound        indylineb2=inxj060.wav    local
  27.     sound        indylineb3=inxj061.wav    local
  28.     sound        indylineb4=inxj090.wav    local
  29.     sound        indylineb5=inxj095.wav    local
  30.  
  31.     thing        indy                    nolink
  32.     thing        player                    local
  33.  
  34.     thing        gearswitch                linkid=2
  35.     thing        spinswitch                linkid=2
  36.  
  37.     thing        statue                    nolink
  38.  
  39.     int            switchcheck=0            local
  40.     int            lastrand=-1                local
  41.     int            currand=0                local
  42.     int            bSpoken=0                local
  43.  
  44. end
  45.  
  46.  
  47. # ========================================================================================
  48.  
  49. code
  50. # ........................................................................................
  51. startup:
  52.  
  53.     player = GetLocalPlayerThing();
  54.  
  55. return;
  56.  
  57. # ........................................................................................
  58. activated:
  59.  
  60.     # Message must be from one of the switches
  61.     if (GetSenderID() != 2) return;
  62.     if (switchcheck != 0) return; 
  63.  
  64.     switchcheck = 1;
  65.  
  66.     if (GetCurItem(player) == 0)
  67.     {
  68.         if (GetCurFrame(statue) == 3) # statue is up and in position
  69.         {
  70.             # Say Azerim line only once...
  71.             if (!bSpoken)
  72.             {
  73.                 bSpoken = 1;
  74.                 Sleep(2.0);
  75.                 PlayVoice(indy, azerimline, 1, 1);
  76.  
  77.                 # Let the switch cogs know the line has been spoken
  78.                 SendMessage(gearSwitchCog, user0);
  79.                 SendMessage(spinSwitchCog, user0);
  80.  
  81.                 # These are set by the switch cogs...time to clean up
  82.                 ClearActorFlags(player, 0x200000);
  83.                 EndCutscene();
  84.             }
  85.         }
  86.         else # statue not up yet
  87.         {
  88.             StopThing(player);
  89.             SetActorFlags(player, 0x200000);
  90.             DeselectWeaponWait(player);
  91.             StartCutscene(1);
  92.  
  93.             PlayMode(player, 60, 1);
  94.  
  95.             currand = RandBetween(0, 3);
  96.             while (lastrand == currand)
  97.             {
  98.                 currand = RandBetween(0, 3);
  99.             }
  100.             lastrand = currand;
  101.  
  102.             PlayVoice(player, indyline0[currand], 1, 1);
  103.             ClearActorFlags(player, 0x200000);
  104.             EndCutscene();
  105.         }
  106.     }
  107.     else # activates with the wrong item
  108.     {
  109.         currand = RandBetween(0, 5);
  110.         while (lastrand == currand)
  111.         {
  112.             currand = RandBetween(0, 5);
  113.         }
  114.         lastrand = currand;
  115.  
  116.         PlayVoice(player, indylineb0[currand], 1, 1);
  117.     }
  118.     switchcheck = 0;
  119.  
  120.     return;
  121.  
  122. end
  123.